package cn.nbt.busManage.model.vo;

import cn.nbt.busManage.model.dto.PointDto;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * {@code @Author} lyq
 * {@code @Date} 6/11/2024 5:08 PM
 */

@Getter
public  class PointVo implements Serializable {
    private final Integer id;
    private final String pointName;
    private final String latitude;
    private final String longitude;

    public PointVo(PointDto pointDto){
        this.id = pointDto.getId();
        this.pointName = pointDto.getPointName();
        this.latitude = pointDto.getLatitude();
        this.longitude = pointDto.getLongitude();
    }

    @JsonCreator
    public PointVo(@JsonProperty("id") Integer id, @JsonProperty("pointName") String pointName,@JsonProperty("latitude") String latitude,@JsonProperty("longitude") String longitude) {
        this.id = id;
        this.pointName = pointName;
        this.latitude = latitude;
        this.longitude = longitude;
    }
}
